package com.ssy.lingxi.member.merchant.controller.web;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.member.merchant.model.vo.basic.request.PlatformUpdatePasswordVO;
import com.ssy.lingxi.member.merchant.service.web.IMemberAccountSecurityService;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @menu 平台后台 - 账户安全相关接口
 * @author 万宁
 * @version 2.0.0
 * @date 2020-12-10
 */
@RestController
@RequestMapping("/member/manage/security")
public class PlatformAccountSecurityController {

    @Resource
    private IMemberAccountSecurityService accountSecurityService;

    /**
     * 平台后台 - 更改用户密码
     * @param headers Http头部信息
     * @param passwordVO 接口参数
     * @return 修改结果
     */
    @RequestMapping("/psw/update")
    public Wrapper<Void> updatePlatformUserPassword(@RequestHeader HttpHeaders headers, @RequestBody @Valid PlatformUpdatePasswordVO passwordVO) {
        return accountSecurityService.updatePlatformUserPassword(headers, passwordVO);
    }
}
